import express from 'express';
import * as notificationRouter from './notification.controller';
import { validateLoginData, authGuard, userGuard } from '../auth/auth.middleware';

const router = express.Router();

/**
 * 获取内容
 */
router.get('/getNotice', authGuard, notificationRouter.index);

/**
 * 获取内容(按 ID)
 */
router.get('/notification/:postId', userGuard, notificationRouter.notificationDetail);

/**
 * 创建内容
 */
router.post('/notice', authGuard, notificationRouter.store);

/**
 * 阅读请求
 */
router.post('/readNotification', authGuard, notificationRouter.read);

/**
 * 更新内容
 */
router.patch('/notification/:postId', notificationRouter.update);

/**
 * 删除内容
 */
router.post('/deletenotice', authGuard, notificationRouter.destroy);

/**
 * 修改状态
 */
router.post('/noticeStatus', authGuard, notificationRouter.status);

/**
 * 导出路由
 */
export default router;
